Final Fantasy Advance and Chrono Trigger DS Font Specifications By Dragonsbrethren Revision 1.2 ------------------------------------------------------------------------------ INTRODUCTION *********************** Final Fantasy IV, V, and VI Advance, and Chrono Trigger DS all store their fonts in the same format. The actual pixel data is stored in the same two bits-per-pixel (2BPP) format that Virtual Boy games use, which is commonly called VB format in tile editors. The properties of the fonts themselves are determined by a header in the "font table," which also contains pointers to each character. The width information for each character is stored before the character itself. ------------------------------------------------------------------------------ FONT TABLES *********************** All font tables begin with an twelve byte header: 00: Unknown, always $00. 01: Unknown, always $00. 02: Unknown, always $00. 03: Unknown, always $00. 04: $46 (F) 05: $4F (O) 06: $4E (N) 07: $54 (T) 08: The height of every character in the font, in pixels. 09: Bit depth (always $02). 10: Number of characters in font (low byte). 11: Number of characters in font (high byte). These are followed by 256 ($FF) bytes of unknown purpose. Next up is a table of 32-bit pointers, one per character, which are used to determine where the header for each character begins. These pointers are relative to the offset of the font table, meaning it is not possible for characters to precede the table. The pointer table is not terminated by anything other than the number of characters in the font. In the unmodified games, the characters themselves directly follow each pointer table, but this is not a requirement. ------------------------------------------------------------------------------ CHARACTER HEADERS AND PIXEL DATA *********************** Each character has a two byte header: 00: Character width, in pixels. 01: Character width, in columns. The first byte only determines when the game will start drawing the next character in a string. For example, if your character is six pixels wide, but you change this to $04, two pixels will overlap the next character. The columns are much more important, and determine how wide the character actually is. One column is four pixels wide, two columns are eight, three are twelve, etc. After the header is the pixel information itself. This 2BPP format stores four pixels per byte; these pixels make up one line of a column. The number of lines needed for each character is determined by the height of the font. For characters with multiple columns, the bytes are interlaced. This means that the first byte is the first line of column one, the second byte is the first line of column two, etc. for each column. This also means that the number of bytes required for a character is equal to the height of the font times the number of columns. Which bits are toggled determines the color of the pixel: 00: Transparent 01: White 10: Black 11: Gray Characters aren't terminated by anything, the game simply doesn't render any bytes past the ones required by the character. The pointers determine where each character begins; for maximum efficiency every character is directly followed by the next in the stock font tables. ------------------------------------------------------------------------------ EDITING *********************** There is now a utility, created by HoRRoR, which can edit these fonts: http://www.romhacking.net/utils/624/ In order to use it, dump the entire font table to a binary file with a .fnt file extension. You can then adjust the character widths, remove characters from the font, and export/import single characters to/from bitmaps. The utility also works with the fonts in Final Fantasy I & II: Dawn of Souls, which this document does not cover. ------------------------------------------------------------------------------ CONTACT INFORMATION *********************** Please email any additions or corrections to the following address: dragonsbrethren-at-gmail.com ------------------------------------------------------------------------------ 2009 Dragonsbrethren Industries